/*
 * Project Name: jmax
 * File Name: FilterGroup.java
 * Copyright: Copyright(C) 1985-2015 ZKTeco Inc. All rights reserved.
 */
package com.xdtech.sys.model;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.OrderBy;
import javax.persistence.Table;

import com.xdtech.core.model.BaseModel;

/**
 * TODO 一句话功能简述，请确保和下面的block tags之间保留一行空行
 * <p>
 * TODO 功能详细描述，若不需要请连同上面的p标签一起删除
 * 
 * @author <a href="max.zheng@zkteco.com">郑志雄</>
 * @version TODO 添加版本
 * @see 相关类或方法，不需要请删除此行
 * @since 2015-3-18 下午2:21:32
 */
@Entity
@Table(name="SYS_FILTER_GROUP")
public class FilterGroup extends BaseModel implements Serializable {
	private static final long serialVersionUID = -5990519423279757631L;
	@Id
    @Column(name = "ID")
    @GeneratedValue(strategy = GenerationType.AUTO)
	protected Long id;
	@Column(name = "GROUP_OPTION")
	private String option;
	
	//过滤规则
	@OneToMany(mappedBy="filterGroup")
	private List<FilterRule> filterRules = new ArrayList<FilterRule>();
//	//父组
//	@ManyToOne
//	@JoinColumn(name="PARENT_ID")
//	private FilterGroup parent;
//	//子组
//	@OneToMany(mappedBy="parent")
//    private List<FilterGroup> childrenGroups = new ArrayList<FilterGroup>();
	@ManyToOne
	@JoinColumn(name="TRANSLATOR_ID")
	private FilterTranslator translator = new FilterTranslator();
	
	
	public FilterGroup() {
		super();
	}
	
	public FilterGroup(Long id) {
		super();
		this.id = id;
	}

	public Long getId()
	{
		return id;
	}
	public void setId(Long id)
	{
		this.id = id;
	}
	public String getOption()
	{
		return option;
	}
	public void setOption(String option)
	{
		this.option = option;
	}
	public List<FilterRule> getFilterRules()
	{
		return filterRules;
	}
	public void setFilterRules(List<FilterRule> filterRules)
	{
		this.filterRules = filterRules;
	}
//	public FilterGroup getParent()
//	{
//		return parent;
//	}
//	public void setParent(FilterGroup parent)
//	{
//		this.parent = parent;
//	}
//	public List<FilterGroup> getChildrenGroups()
//	{
//		return childrenGroups;
//	}
//	public void setChildrenGroups(List<FilterGroup> childrenGroups)
//	{
//		this.childrenGroups = childrenGroups;
//	} 
	public FilterTranslator getTranslator()
	{
		return translator;
	}
	public void setTranslator(FilterTranslator translator)
	{
		this.translator = translator;
	}

	
}
